<template>
    <div >
        <Alert>
            <h2  >审批记录</h2>
        </Alert>
        <Table :columns="columns" :data="dataList" border ref="recordTable" closeable="false " :loading="loading">
            <template slot="approveSuggest" slot-scope="{ row, index }">
                <div v-if="row.approveSuggest=='submit'">
                    <span>提交</span>
                </div>
                <div v-if="row.approveSuggest=='back'">
                    <span>退回</span>
                </div>
            </template>
        </Table>
    </div>
</template>

<script>
    import {listAllRecord} from "@/projects/afs-core-business/api/afs-product/approve-record/productApproveRecord";
    export default {
        name: "product-approve-record",
        props: {
            stageId: {
                type: [Number, String],
                default: ''
            }
        },
        data() {
            return {
                columns: [
                    {
                        title: "节点名称",
                        key: "disposeNodeName",
                        minWidth: 80,
                    },
                    {
                        title: "处理人",
                        key: "disposeStaff",
                        minWidth: 80,
                    },
                    {
                        title: "审批意见",
                        key: "approveSuggest",
                        minWidth: 80,
                        slot: "approveSuggest",
                    },
                    {
                        title: "审批时间",
                        key: "approveEndTime",
                        type: 'datetime',
                        minWidth: 100,
                    },
                    {
                        title: "审批备注",
                        key: "approveRemark",
                        minWidth: 300,
                    }
                ],
                dataList: [],
                loading: false,
            }
        },
        methods: {
            init() {
                this.loading = true;
                listAllRecord({stageId: this.stageId}).then(res => {
                    this.loading = false;
                    if (res.code == "0000") {
                        this.dataList = res.data;
                    }
                });
            },

        },
        computed: {

        },
        mounted() {
            this.init();
        },
    }
</script>

<style scoped>

</style>
